<?php
/**
 * File: deleteMember.php
 * Author: camy <375766145@qq.com>
 * Time: 2018/3/22 09:21
 */

namespace Common\Extend\DingTalk\Message\Project;

use Common\Extend\DingTalk\Message\BaseMessage;

class DeleteMember extends BaseMessage
{
    public function send($param)
    {
        //标题
        $this->title = '项目提醒';
        $member = M('projectMember')->find($param['id']);
        //发送人
        $people = $this->getUserId($member['user_id']);
        //发送内容
        $projectName = M('project')
            ->where(['id' => intval($member['project_id'])])
            ->getField('name');
        $text = "你被移出【{$projectName}】项目组";
        $message = $this->getMessage($text);
        //发送消息
        dingtalk()->sendMessage($people, $message);
    }
}